package com.leo.sunnyweather.logic.network

import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory

/**
 * Author: Leo Liao <lliao@midtronics.com>
 * Date: 31/01/2024 13:49
 * Description:
 */
object ServiceCreator {
    private const val BASE_URL = "https://api.caiyunapp.com/"
    private var retrofit =
        Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory.create())
            .build()

    fun <T> create(cls: Class<T>) = retrofit.create(cls)

    inline fun <reified T> create():T = create(T::class.java)

}